package com.db.memberInfo;

import java.io.Reader;
import java.sql.SQLException;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class MemberInfoManager {
	private static SqlMapClient sqlmap;
	static {
		try {
			Reader reader = Resources
					.getResourceAsReader("com/db/config/SqlMapConfig.xml");
			sqlmap = SqlMapClientBuilder.buildSqlMapClient(reader);
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
	
	public static MemberInfoVO getMemberInfo(int memno) throws SQLException{
		System.out.println("memno" + memno);
		return (MemberInfoVO)sqlmap.queryForObject("getMemberInfo", memno);
	}
	
	public static void memberInfoUpdate(MemberInfoVO vo) throws SQLException{
		sqlmap.update("memberInfoUpdate", vo);		
	}
}
